<?xml version="1.0" encoding="UTF-8" ?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
	xmlns:c="http://java.sun.com/jsp/jstl/core" version="2.0">
	<jsp:directive.page contentType="text/html; charset=UTF-8"
		pageEncoding="UTF-8" session="true" />
	<jsp:output doctype-root-element="html"
		doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
		doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
		omit-xml-declaration="true" />
	<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<jsp:include page="../public/jsp/headerScript.jsp" />
<title>Game|Detail</title>
<script type="text/javascript">
	$(document).ready(function() {
		$(".starRadio").children().not(":input").hide();
		$(".starRadio").stars({
			disabled : true,
		});
		$(".starRadio").stars('select', $("input[name='ratValue']").val());

	});
</script>
</head>
<body>
	<jsp:include page="../public/jsp/header_nav.jsp" />
	<div id="content">
		<div id="featured-wrap">
			<article id="featured" class="clearfix">
				<div class="content-margin">
					<c:if test="${not empty gameContent }">
						<input type="hidden" name="id" value="${gameContent.id}" />
						<div class="image-block">
							<img src="public/images/games/${gameContent.image}" />
							<div class="ctrlHolder">
								<p class="label">
									<em>Rating:</em>
								</p>
								<div class="starRadio">
									<label for="vote1" class="blockLabel"> <input
										type="radio" name="vote" id="vote1" value="1" /> Poor
									</label> <label for="vote2" class="blockLabel"> <input
										type="radio" name="vote" id="vote2" value="2" /> Fair
									</label> <label for="vote3" class="blockLabel"> <input
										type="radio" name="vote" id="vote3" value="3"
										checked="checked" /> Average
									</label> <label for="vote4" class="blockLabel"> <input
										type="radio" name="vote" id="vote4" value="4" /> Good
									</label> <label for="vote5" class="blockLabel"> <input
										type="radio" name="vote" id="vote5" value="5" /> Excellent
									</label> <input name="ratValue" type="hidden"
										value="${gameContent.rating}" />
								</div>
							</div>
						</div>
						<div class="text-block">
							<h2>${gameContent.name}</h2>
							<p>Company: ${gameContent.company}</p>
							<p>Description: ${gameContent.summary}</p>
							<p>Release Date: ${gameContent.releaseDate}</p>
							<p>
								Website: <a href="${gameContent.website}">${gameContent.website}</a>
							</p>

						</div>
					</c:if>
				</div>
			</article>
			<c:if test="${ empty reviewList}">
				<article id="featured" class="clearfix">
					<div class="content-margin">
						<p>No Reivew yet!</p>
					</div>
				</article>
			</c:if>
			<c:forEach var="i" items="${reviewList}" varStatus="theCount">
				<article id="featured" class="clearfix">
					<div class="content-margin">
						<input type="hidden" name="gameid" value="${i.game_id}" />
						<h3>${i.title}</h3>
						<div class="commentbox">${i.content}</div>
						<div>Posted by ${i.author} on
							${i.postDate}</div>
					</div>
				</article>
			</c:forEach>
			<article id="featured" class="clearfix">
				<div class="content-margin">
					<c:choose>
						<c:when test="${not empty sessionScope.username}">
							<jsp:include page="../views/review.jsp" />
						</c:when>
						<c:otherwise>
							<p>
								Post your Review? Please <a href="Login">Login</a>
							</p>
						</c:otherwise>
					</c:choose>
				</div>
			</article>
		</div>
	</div>
	<jsp:include page="../public/jsp/footer_nav.jsp" />
</body>
	</html>
</jsp:root>